package com.pers.springcloud.controller;

import com.pers.springcloud.entities.JSONResult;
import com.pers.springcloud.entities.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: 黄建
 * @Date: 2020/3/6 18:23
 */
@RestController
@Slf4j
@RequestMapping(value = "/consumer")
public class OrderConsulController {

    public static final String PAYMENT_URL = "http://consul-provider-payment";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/payment/consul")
    public String zk(){
        return restTemplate.getForObject(PAYMENT_URL+"/payment/consul",String.class);
    }


}
